<div class="pub-body">
    <!-- <h1>公司管理</h1> -->
    <!-- 公司列表 -->
    <div class="project">
        <!-- <el-button icon="el-icon-plus" class="addBtn" type="primary" @click="dialogCompanyOpen">新增项目</el-button> -->
        <el-table :data="companyData" border style="width: 100%" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
            <el-table-column prop="contractNo" label="项目ID" ></el-table-column>
            <el-table-column prop="assetName" label="项目名称"></el-table-column>
            <el-table-column prop="assetType" label="总投资额"></el-table-column>
            <el-table-column prop="assetLevel" label="所有付款节点数" ></el-table-column>
            <el-table-column prop="statistics" label="已付款节点数"></el-table-column>
            <el-table-column prop="startTime" label="计划开始时间"></el-table-column>
            <el-table-column prop="endTime" label="计划结束时间"></el-table-column>
            <!-- <el-table-column prop="construction" label="主要参建单位" ></el-table-column> -->
            <el-table-column fixed="right" label="操作" width="300">
                <template slot-scope="scope">
                    <el-button @click="showemplate.status = true" type="primary" icon="el-icon-edit-outline" size="small">新增合同</el-button>
                    <el-button @click="lookTemplateOpen(scope.row)" type="primary" icon="el-icon-tickets" size="small" >查看合同</el-button>

                    <!-- <el-button @click="updateTemplateOpen(scope.row)" type="warning" icon="el-icon-edit-outline" size="small">修改项目</el-button> -->
                </template>
            </el-table-column>
        </el-table>
    </div>

    <!-- 新增模板弹窗 -->
    <el-dialog width="1000px" :title="dialogCompany.title" :visible.sync="dialogCompany.status">
        <el-form ref="companyFrom" :rules="companyRules" :model="companyFrom" label-width="160px">
            <el-table-column prop="contractNo" label="项目ID" ></el-table-column>
            <el-table-column prop="assetName" label="项目名称" ></el-table-column>
            <el-table-column prop="assetType" label="项目类型"></el-table-column>
            <el-table-column prop="assetLevel" label="项目层级"></el-table-column>
            <el-table-column prop="statistics" label="是否列统"></el-table-column>
            <el-table-column prop="startTime" label="计划开始时间"></el-table-column>
            <el-table-column prop="endTime" label="计划结束时间"></el-table-column>
            <el-table-column prop="construction" label="主要参建单位" ></el-table-column>
            <el-table-column prop="investment" label="总投资" ></el-table-column>
            <el-table-column prop="legalUnit" label="项目法人单位" ></el-table-column>
            <el-table-column prop="site" label="建设地点" ></el-table-column>
            <el-row>
                <el-col :span="12">
                    <el-form-item prop="assetName" label="项目名称">
                        <el-input style="width: 300px;" placeholder="请输入模板名称" v-model="companyFrom.companyName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item prop="assetType" label="项目类型">
                        <el-input style="width: 300px;" placeholder="请输入项目类型" v-model="companyFrom.companyContact"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item prop="assetLevel" label="项目层级">
                        <el-input style="width: 300px;" placeholder="请输入项目层级" v-model="companyFrom.companyName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item prop="statistics" label="是否列统">
                        <el-input style="width: 300px;" placeholder="请输入项目是否列统" v-model="companyFrom.companyContact"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>

            <el-row>
                <el-col :span="12">
                    <el-form-item prop="startTime" label="计划开始时间">
                        <el-date-picker type="date" placeholder="计划开始时间" v-model="companyFrom.restrictedType" style="width: 300px;"></el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item prop="endTime" label="计划结束时间">
                        <el-date-picker type="date" placeholder="计划结束时间" v-model="companyFrom.restrictedType" style="width: 300px;"></el-date-picker>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item prop="construction" label="主要参建单位">
                        <el-input style="width: 300px;" placeholder="请输入主要参建单位" v-model="companyFrom.companyName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item prop="investment" label="总投资">
                        <el-input style="width: 300px;" placeholder="请输入总投资" v-model="companyFrom.companyContact"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item prop="legalUnit" label="项目法人单位">
                        <el-input style="width: 300px;" placeholder="请输入项目法人单位" v-model="companyFrom.companyName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item prop="site" label="建设地点">
                        <el-input style="width: 300px;" placeholder="请输入建设地点" v-model="companyFrom.companyContact"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-form-item>
                <el-button type="primary" @click="addCompany('companyFrom')"><span v-text="dialogCompany.title"></span></el-button>
                <el-button @click="resetCompany">重置</el-button>
            </el-form-item>
        </el-form>
    </el-dialog>
    <!-- 查看模板弹窗 -->
    <el-dialog width="1000px" :title="looktemplate.title" :visible.sync="looktemplate.status">
        <el-table :data="lookdata" border style="width: 100%" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
            <el-table-column prop="contractNo" label="项目ID" ></el-table-column>
            <el-table-column prop="assetName" label="项目名称" ></el-table-column>
            <el-table-column prop="assetType" label="项目类型"></el-table-column>
            <el-table-column prop="assetLevel" label="项目层级"></el-table-column>
            <el-table-column prop="statistics" label="是否列统"></el-table-column>
            <el-table-column prop="startTime" label="计划开始时间"></el-table-column>
            <el-table-column prop="endTime" label="计划结束时间"></el-table-column>
            <el-table-column prop="construction" label="主要参建单位" ></el-table-column>
            <el-table-column prop="investment" label="总投资" ></el-table-column>
            <el-table-column prop="legalUnit" label="项目法人单位" ></el-table-column>
            <el-table-column prop="site" label="建设地点" ></el-table-column>
            <el-table-column prop="plate" label="板块" ></el-table-column>
            <el-table-column prop="task1" label="节点" ></el-table-column>
            <el-table-column prop="task2" label="节点" ></el-table-column>
            <el-table-column prop="task3" label="节点" ></el-table-column>
            <el-table-column prop="task4" label="节点" ></el-table-column>
            <el-table-column prop="task5" label="..." ></el-table-column>
        </el-table>
    </el-dialog>
     <!-- 修改模板弹窗 -->
     <el-dialog width="1000px" :title="updatetemplate.title" :visible.sync="updatetemplate.status">
        <el-form ref="companyFrom" :rules="companyRules" :model="companyFrom" label-width="160px">
            <el-row>
                <el-col :span="12">
                    <el-form-item prop="companyName" label="模板名称">
                        <el-input style="width: 300px;" placeholder="请输入模板名称" v-model="companyFrom.companyName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item prop="companyContact" label="创建人">
                        <el-input style="width: 300px;" placeholder="请输入创建人" v-model="companyFrom.companyContact"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item prop="companyTel" label="项目分类">
                        <el-select style="width: 300px;" v-model="companyFrom.companyTel" placeholder="请选择项目类型">
                            <el-option label="楼宇" value="1"></el-option>
                            <el-option label="市政" value="2"></el-option>
                            <el-option label="其他" value="3"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item prop="requisitionLimit" label="专项名称">
                        <el-select style="width: 300px;" v-model="companyFrom.requisitionLimit" placeholder="请选择专项">
                            <el-option label="土地" value="1"></el-option>
                            <el-option label="前期" value="2"></el-option>
                            <el-option label="其他" value="3"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item prop="restrictedType" label="创建时间">
                        <el-col class="dateCol" :span="12">
                            <el-date-picker type="date" placeholder="创建时间" v-model="companyFrom.restrictedType" style="width: 100%;"></el-date-picker>
                        </el-col>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item prop="restrictedType1" label="选择节点">
                        <el-transfer v-model="companyFrom.restrictedType1" @change="handleChange" :data="tempData"></el-transfer>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-form-item>
                <el-button type="primary" @click="addCompany('companyFrom')"><span v-text="dialogCompany.title"></span></el-button>
                <el-button @click="resetCompany">重置</el-button>
            </el-form-item>
        </el-form>
     </el-dialog>
     <!-- 查看弹窗 -->
     <el-dialog width="80%" :title="showemplate.title" :visible.sync="showemplate.status">
         <!-- 项目节点树 -->
        <el-row :gutter="30">
            <el-col :span="24">
                <el-tree style="height: 500px; overflow: hidden; overflow-y: auto;" class="projectDataTree" default-expand-all :data="projectData" node-key="id" :expand-on-click-node="false">
                    <span class="custom-tree-node" slot-scope="{ node, data }">
                        <span v-if="data.id != 0" @click="() => nodeInfo(data)" style="line-height: 35px; float: left;">{{ node.label }}</span>
                        <span v-else style="line-height: 35px; float: left;">{{ node.label }}</span>
                        <div class="nodeInfo" style="float: right !important;">
                            <span>{{ data.startTime }}</span>
                            <span>{{ data.endTime }}</span>
                            <span>{{ data.plannedHours }}</span>
                            <span>{{ data.precondition }}</span>
                            <span>{{ data.responsibleDepartment }}</span>
                            <span class="tree-btn" style="float: right !important; width: 280px;">
                                <el-button v-if="data.id != 0" type="primary" icon="el-icon-plus" size="mini" @click="() => append(data)">新增</el-button>
                                <!-- <el-button v-if="data.id != 0" type="warning" icon="el-icon-edit" size="mini" @click="() => nodeInfo(data)">修改</el-button>
                                <el-button v-if="data.id != 0" type="danger" icon="el-icon-minus" size="mini" @click="() => remove(node, data)">删除</el-button> -->
                            </span>
                        </div>
                        <!--  -->
                    </span>
                </el-tree>
            </el-col>
        </el-row>

        <!-- 项目节点新增 -->
        <el-dialog :title="appendNode.title" width="40%" :visible.sync="appendNode.status">
            <el-form ref="appendNodeFrom" :rules="appendNodeRules" :model="appendNodeFrom" label-width="160px">
                <el-form-item prop="id" label="合同编号">
                    <el-input style="width: 350px;" placeholder="请输入合同编号" v-model="appendNodeFrom.id"></el-input>
                </el-form-item>
                <el-form-item prop="name" label="合同名称">
                    <el-input style="width: 350px;" placeholder="请输入合同名称" v-model="appendNodeFrom.name"></el-input>
                </el-form-item>
                <el-form-item prop="label" label="付款项">
                    <el-input style="width: 350px;" placeholder="请输入付款项" v-model="appendNodeFrom.label"></el-input>
                </el-form-item>
                <el-form-item prop="responsibleDepartment" label="责任部门">
                    <el-select v-model="appendNodeFrom.responsibleDepartment" placeholder="请选择责任部门" style="width: 350px;">
                        <el-option v-for="item in departmentList" :label="item" :key="item" value="item"></el-option>
                        <!-- <el-option label="规土部" value="规土部"></el-option>
                        <el-option label="财务部" value="财务部"></el-option>
                        <el-option label="工程部" value="工程部"></el-option> -->
                    </el-select>
                    <!-- <el-input style="width: 350px;" placeholder="请输入责任部门" v-model="appendNodeFrom.responsibleDepartment"></el-input> -->
                </el-form-item>
                <el-form-item label="合同签订日期" prop="timeValue">
                    <el-date-picker type="date" placeholder="签订日期" v-model="companyFrom.timeValue" style="width: 350px;"></el-date-picker>
                </el-form-item>
                <el-form-item prop="plannedHours" label="付款方">
                    <el-input style="width: 350px;" placeholder="请输入付款方" v-model="appendNodeFrom.plannedHours"></el-input>
                </el-form-item>
                <el-form-item prop="precondition" label="收款方">
                    <el-input style="width: 350px;" placeholder="请输入收款方" v-model="appendNodeFrom.precondition"></el-input>
                </el-form-item>
                <el-form-item prop="moneynum" label="交易金额">
                    <el-input style="width: 350px;" placeholder="请输入交易金额" v-model="appendNodeFrom.precondition"></el-input>
                </el-form-item>
                <el-form-item prop="desc" label="上传合同" >
                    <el-upload
                        class="upload-demo"
                        drag
                        action="https://jsonplaceholder.typicode.com/posts/"
                        multiple
                        prop="uploadht">
                        <i class="el-icon-upload"></i>
                        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                    </el-upload>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitForm('appendNodeFrom')">提交</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>
        </el-dialog>
</div>
